<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <rich:panel>
        <f:facet name="header">Recurso Details</f:facet>


        <s:decorate id="nome" template="layout/display.xhtml">
            <ui:define name="label">Nome</ui:define>
            <h:outputText value="#{recursoHome.instance.nome}"/>
        </s:decorate>

        <div style="clear:both"/>

    </rich:panel>

    <div class="actionButtons">

        <s:button view="/RecursoEdit.xhtml"
                    id="edit"
                 value="Edit"/>

        <s:button view="/#{empty recursoFrom ? 'RecursoList' : recursoFrom}.xhtml"
                    id="done"
                 value="Done"/>

    </div>

    <rich:tabPanel switchType="ajax">

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/manytoone.gif" style="vertical-align: middle; padding-right: 4px;"/>Tiporecurso</h:panelGroup>
        </f:facet>
    <div class="association" id="tiporecursoParent">

        <h:outputText value="There is no tiporecurso associated with this recurso."
                   rendered="#{recursoHome.instance.tiporecurso == null}"/>

        <rich:dataTable var="_tiporecurso"
                   value="#{recursoHome.instance.tiporecurso}"
                rendered="#{recursoHome.instance.tiporecurso != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="tiporecursoTable">
            <h:column>
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_tiporecurso.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Nome</f:facet>
                <h:outputText value="#{_tiporecurso.nome}"/>
            </h:column>
            <h:column styleClass="action">
                <f:facet name="header">Action</f:facet>
                <s:link id="viewtiporecurso"
                     value="View"
                      view="/Tiporecurso.xhtml">
                    <f:param name="tiporecursoId"
                           value="#{_tiporecurso.id}"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/onetomany.gif" style="vertical-align: middle; padding-right: 4px;"/>Utilizacaorecursos</h:panelGroup>
        </f:facet>
    <h:form styleClass="association" id="utilizacaorecursosChildren">

        <h:outputText value="There are no utilizacaorecursos associated with this recurso."
                   rendered="#{empty recursoHome.utilizacaorecursos}"/>

        <rich:dataTable value="#{recursoHome.utilizacaorecursos}"
                       var="_utilizacaorecurso"
                  rendered="#{not empty recursoHome.utilizacaorecursos}"
                rowClasses="rvgRowOne,rvgRowTwo"
                        id="utilizacaorecursosTable">
            <rich:column sortBy="#{_utilizacaorecurso.id.recursoid}">
                <f:facet name="header">Recursoid</f:facet>
                <h:outputText value="#{_utilizacaorecurso.id.recursoid}"/>
            </rich:column>
            <rich:column sortBy="#{_utilizacaorecurso.id.tarefaid}">
                <f:facet name="header">Tarefaid</f:facet>
                <h:outputText value="#{_utilizacaorecurso.id.tarefaid}"/>
            </rich:column>
            <rich:column sortBy="#{_utilizacaorecurso.custo}">
                <f:facet name="header">Custo</f:facet>
                <h:outputText value="#{_utilizacaorecurso.custo}"/>
            </rich:column>
            <h:column>
                <f:facet name="header">Action</f:facet>
                <s:link id="selectutilizacaorecurso"
                     value="Select"
                      view="/Utilizacaorecurso.xhtml">
                    <f:param name="utilizacaorecursoRecursoid"
                            value="#{_utilizacaorecurso.id.recursoid}"/>
                    <f:param name="utilizacaorecursoTarefaid"
                            value="#{_utilizacaorecurso.id.tarefaid}"/>
                    <f:param name="utilizacaorecursoFrom" value="Recurso"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </h:form>

    <div class="actionButtons">
        <s:button
               value="Add utilizacaorecurso"
                view="/UtilizacaorecursoEdit.xhtml">
            <f:param name="recursoId"
                    value="#{recursoHome.instance.id}"/>
            <f:param name="utilizacaorecursoFrom" value="Recurso"/>
        </s:button>
    </div>
    </rich:tab>
</rich:tabPanel>
</ui:define>

</ui:composition>
